class Observee(object):
    def __init__(self):
        super(Observee, self).__init__()
        self._observers = []

    def attach(self, observer):
        if not observer in self._observers:
            observer(self)
            self._observers.append(observer)

    def detach(self, observer):
        try:
            self._observers.remove(observer)
        except ValueError:
            pass

    def notify(self):
        for observer in self._observers:
            observer(self)
